package com.tencent.mm.opensdk.modelmsg;

import android.os.Bundle;
import android.util.Log;

import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage.Builder;

public class SendMessageToWX {
    public static class Req extends BaseReq {
        private static final int FAV_CONTENT_LENGTH_LIMIT = 26214400;
        private static final String TAG = "MicroMsg.SDK.SendMessageToWX.Req";
        public static final int WXSceneFavorite = 2;
        public static final int WXSceneSession = 0;
        public static final int WXSceneTimeline = 1;
        public WXMediaMessage message;
        public int scene;

        public Req() {

        }

        public Req(Bundle arg1) {

            this.fromBundle(arg1);
        }

        public boolean checkArgs() {
            boolean v0;
            if (this.message == null) {
                Log.e("MicroMsg.SDK.SendMessageToWX.Req", "checkArgs fail ,message is null");
                v0 = false;
            } else {
                if (this.message.mediaObject.type() == 6 && this.scene == 2) {
                    ((WXFileObject) this.message.mediaObject).setContentLengthLimit(26214400);
                }

                v0 = this.message.checkArgs();
            }

            return v0;
        }

        public void fromBundle(Bundle arg2) {
            super.fromBundle(arg2);
            this.message = Builder.fromBundle(arg2);
            this.scene = arg2.getInt("_wxapi_sendmessagetowx_req_scene");
        }

        public int getType() {
            return 2;
        }

        public void toBundle(Bundle arg3) {
            super.toBundle(arg3);
            arg3.putAll(Builder.toBundle(this.message));
            arg3.putInt("_wxapi_sendmessagetowx_req_scene", this.scene);
        }
    }

    public static class Resp extends BaseResp {
        public Resp() {

        }

        public Resp(Bundle arg1) {

            this.fromBundle(arg1);
        }

        public boolean checkArgs() {
            return true;
        }

        public void fromBundle(Bundle arg1) {
            super.fromBundle(arg1);
        }

        public int getType() {
            return 2;
        }

        public void toBundle(Bundle arg1) {
            super.toBundle(arg1);
        }
    }

    private SendMessageToWX() {

    }
}

